'use strict';

const RouterService = require('../base');

class PostService extends RouterService {
    static get modelName() {
        return 'Business.Post';
    }

    getPageInclude() {
        return [
            {
                model: this.ctx.model.Business.User,
                as: 'user'
            },
            {
                // 评论求数量
                model: this.ctx.model.Business.PostComment,
                as: 'comments',
            },
            {
                // 点赞求数量
                model: this.ctx.model.Business.PostLike,
                as: 'likes',
            }
        ]
    }
    getDetailInclude() {
        return this.getPageInclude()
    }
}

module.exports = PostService;
